<template>
  <view class="" style="width: 100%;">
    <web-view :src="url" @message ="message"></web-view>
  </view>
</template>
 
<script>
export default {
  data() {
    return {
      url:'http://192.168.0.49:8081'
    };
  },

  onReady() {  
     // #ifdef H5
     window.addEventListener("message", this.message, false)  
     // #endif  
			
  },   
  methods: {
    message(event){
		console.log(event)
		
		// #ifdef APP-PLUS
		if(event.detail.data[0].action=='success'){
			console.log('跳转页面')
			
			uni.navigateTo({
				url:'new'
			})
		}
		// #endif  
			
		
		
    }
  }
};
</script>
 
<style scoped="scoped" lang="scss">
</style>
